// ToolBox.cpp : implementation file
//

#include "stdafx.h"
#include "UIEditor_CPP.h"
#include "ToolBox.h"


// CToolBox

IMPLEMENT_DYNAMIC(CToolBox, CDockablePane)

CToolBox::CToolBox()
{


}

CToolBox::~CToolBox()
{
}


BEGIN_MESSAGE_MAP(CToolBox, CDockablePane)
	ON_WM_CREATE()
	ON_WM_PAINT()
END_MESSAGE_MAP()



// CToolBox message handlers



int CToolBox::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
	if (CDockablePane::OnCreate(lpCreateStruct) == -1)
		return -1;

	// TODO:  Add your specialized creation code here

	CButton * pBtn = NULL;
	CRect clientRect;
	GetClientRect(&clientRect);


	/*CRect btnRect(2,0,clientRect.Width()-10,20);
	for (int i = 0; i < 10; i++)
	{
	pBtn = new CButton;
	if (pBtn->Create(L"button", WS_VISIBLE | BS_PUSHBUTTON, btnRect, this, i))
	{
	TRACE("fail create btn\r\n");
	m_btnControls.AddTail(pBtn);
	}
	btnRect.top = btnRect.bottom + 10;
	btnRect.bottom = btnRect.top + 20;
	}*/
	
	return 0;
}

void CToolBox::OnPaint()
{
	CPaintDC dc(this); // device context for painting
	// TODO: Add your message handler code here
	// Do not call CDockablePane::OnPaint() for painting messages


	CRect rt;
	GetClientRect(&rt);
	dc.Draw3dRect(rt, ::GetSysColor(COLOR_3DSHADOW), ::GetSysColor(COLOR_3DSHADOW));
	CBrush brush;
	brush.CreateSolidBrush(RGB(255,255,255));
	dc.FillRect(&rt, &brush);


	CRect rectTree;
	GetClientRect(&rectTree);

	rectTree.InflateRect(-1, -1);
	dc.Draw3dRect(rectTree, RGB(255,0,0), RGB(255,0,0));
}
